/*
 * @Author: fangzhi 
 * @Date: 2018-04-18 15:47:50 
 * @Last Modified by: fangzhi
 * @Last Modified time: 2018-12-03 19:27:12
 */

// 路由配置
import Vue from 'vue'
import Router from 'vue-router'
// 配置路由主界面
import index from '@/components/index'
// 登陆页
import login from "@/components/login/index.vue"
// 主页页面
import home from "@/components/home/index.vue"
// 会员管理
import addMember from "@/components/home/memberManagement/addMember.vue" // 新增会员
import memberInfo from "@/components/home/memberManagement/memberInfo.vue" // 会员账户信息
import manageMember from "@/components/home/memberManagement/manageMember.vue" // 全部会员管理
// 平台交易
import tradingDashboard from "@/components/home/tradingDesk/tradingDashboard.vue" // 交易信息汇总
import tradingInfo from "@/components/home/tradingDesk/tradingInfo.vue" // 平台交易信息
import withdrawInfo from "@/components/home/tradingDesk/withdrawInfo.vue" 
import QRcodeInfo from "@/components/home/tradingDesk/QRcodeInfo.vue" // 扫码交易信息
import benefitInfo from "@/components/home/tradingDesk/benefitInfo.vue" // 分润信息
import rebateDetail from "@/components/home/tradingDesk/rebateDetail.vue" // 返佣信息
import channelInfo from "@/components/home/tradingDesk/channelInfo.vue" // 通道信息
import publishMessage from "@/components/home/tradingDesk/publishMessage.vue" // 信息推送

// 贴牌管理
import addBrand from "@/components/home/brandManagement/addBrand.vue" // 新增品牌
import addChannel from '@/components/home/brandManagement/addChannel.vue' // 新增渠道
import channelManage from '@/components/home/brandManagement/channelManage.vue' // 渠道管理
import toggleBrand from "@/components/home/brandManagement/toggleBrand.vue" // 品牌切换
import cancelAccount from "@/components/home/brandManagement/cancelAccount.vue" // 账号注销
import toggleRouter from "@/components/home/brandManagement/toggleRouter.vue" // 路由切换
import manageVersions from "@/components/home/brandManagement/manageVersions.vue" // 版本管理
import setBrandRate from "@/components/home/brandManagement/setBrandRate.vue" // 设置公共费率费率
import setThirdpartyRate from "@/components/home/brandManagement/setThirdpartyRate.vue" // 设置第三方费率
import customerServices from "@/components/home/brandManagement/customerServices.vue" // 400客户电话修改
import manageAdvertising from "@/components/home/brandManagement/manageAdvertising.vue" // 广告投放

// 通道管理
import channelShopList from '@/components/home/channelManagement/shopChannel.vue' // 通道商户列表
import channelShopDetail from '@/components/home/channelManagement/shopChannelDetail.vue' // 通道商户列表

// 认证管理
import authInfo from "@/components/home/identificationManagement/authInfo.vue" // 审核列表
import authRealname from "@/components/home/identificationManagement/authRealname.vue" // 实名认证
import checkRealname from "@/components/home/identificationManagement/checkRealname.vue" // 实名审核
import checkShop from "@/components/home/identificationManagement/checkShop.vue" // 商户审核
// 权限管理
import manageBlacklist from "@/components/home/authorityManagement/manageBlacklist.vue" // 黑名单管理
import setRolePermission from "@/components/home/authorityManagement/setRolePermission.vue" // 角色权限管理
// 商户管理
import TerminalInfo from "@/components/home/shopManagement/terminalInfo.vue" // 终端管理
import TerminalManage from "@/components/home/shopManagement/terminalManage.vue" //终端详情管理
import ShopInfo from '@/components/home/shopManagement/shopInfo.vue' // 全部商户
import AddShop from "@/components/home/shopManagement/addShop.vue" // 添加商户
import ShopDetail from '@/components/home/shopManagement/shopDetail.vue' // 商户详情 shopId
import ShopAuth from '@/components/home/shopManagement/shopAuth.vue' // 商户审核
import ShopAuthDetail from '@/components/home/shopManagement/shopAuthDetail.vue' // 审核详情
import SubbranchInfo from "@/components/home/shopManagement/subbranchInfo.vue" // 门店管理
import SubbranchDetail from "@/components/home/shopManagement/subbranchDetail.vue" // 门店详情 添加门店
import ShopConfig from "@/components/home/shopManagement/shopConfig.vue" // 商户配置 
import ShopChannelList from "@/components/home/shopManagement/shopChannelList.vue" // 通道商户同步
 
// 台码管理
import AddCode from "@/components/home/paymentCode/addCode.vue" // 添加台码
import ManageCode from "@/components/home/paymentCode/manageCode.vue" // 管理台码
import SwitchAgent from '@/components/home/paymentCode/switchAgent.vue'

Vue.use(Router)

export default new Router({
    routes: [{
            path: '/',
            redirect: "/home",
            component: home,
        },
        {
            path: '/index',
            name: 'index',
            redirect: "home",
            component: index,
            children: [{
                    path: "/home",
                    name: "home",
                    meta: {
                        requireAuth: true,
                    },
                    component: home
                },
                {
                    path: "/member/addMember",
                    name: "addMember",
                    meta: {
                        requireAuth: true,
                    },
                    component: addMember
                },
                {
                    path: "/member/memberInfo",
                    name: "memberInfo",
                    meta: {
                        requireAuth: true,
                    },
                    component: memberInfo
                },
                {
                    path: "/member/manageMember",
                    name: "manageMember",
                    meta: {
                        requireAuth: true,
                    },
                    component: manageMember
                },
                {
                    path: "/trading/tradingDashboard",
                    name: "tradingDashboard",
                    meta: {
                        requireAuth: true,
                    },
                    component: tradingDashboard
                },
                {
                    path: "/trading/tradingInfo",
                    name: "tradingInfo",
                    meta: {
                        requireAuth: true,
                    },
                    component: tradingInfo
                },
                {
                    path: "/trading/withdrawInfo",
                    name: "withdrawInfo",
                    meta: {
                        requireAuth: true,
                    },
                    component: withdrawInfo 
                },
                {
                    path: "/trading/QRcodeInfo",
                    name: "QRcodeInfo",
                    meta: {
                        requireAuth: true,
                    },
                    component: QRcodeInfo
                    
                },
                {
                    path: "/trading/benefitInfo",
                    name: "benefitInfo",
                    meta: {
                        requireAuth: true,
                    },
                    component: benefitInfo
                },
                {
                    path: "/trading/rebateDetail",
                    name: "rebateDetail",
                    meta: {
                        requireAuth: true,
                    },
                    component: rebateDetail
                },
                {
                    path: "/trading/channelInfo",
                    name: "channelInfo",
                    meta: {
                        requireAuth: true,
                    },
                    component: channelInfo
                },
                {
                    path: "/trading/publishMessage",
                    name: "publishMessage",
                    meta: {
                        requireAuth: true,
                    },
                    component: publishMessage
                },
                {
                    path: "/brand/addBrand",
                    name: "addBrand",
                    meta: {
                        requireAuth: true,
                    },
                    component: addBrand
                },
                {
                    path: "/brand/addChannel",
                    name: "addChannel",
                    meta: {
                        requireAuth: true,
                    },
                    component: addChannel
                    
                },
                {
                    path: "/brand/channelManage",
                    name: "channelManage",
                    meta: {
                        requireAuth: true,
                    },
                    component: channelManage
                    
                },
                {
                    path: "/brand/toggleBrand",
                    name: "toggleBrand",
                    meta: {
                        requireAuth: true,
                    },
                    component: toggleBrand
                },
                {
                    path: "/brand/cancelAccount",
                    name: "cancelAccount",
                    meta: {
                        requireAuth: true,
                    },
                    component: cancelAccount
                },
                {
                    path: "/brand/toggleRouter",
                    name: "toggleRouter",
                    meta: {
                        requireAuth: true,
                    },
                    component: toggleRouter
                },
                {
                    path: "/brand/manageVersions",
                    name: "manageVersions",
                    meta: {
                        requireAuth: true,
                    },
                    component: manageVersions
                },
                {
                    path: "/brand/setBrandRate",
                    name: "setBrandRate",
                    meta: {
                        requireAuth: true,
                    },
                    component: setBrandRate
                },
                {
                    path: "/brand/setThirdpartyRate",
                    name: "setThirdpartyRate",
                    meta: {
                        requireAuth: true,
                    },
                    component: setThirdpartyRate
                },
                {
                    path: "/brand/customerServices",
                    name: "customerServices",
                    meta: {
                        requireAuth: true,
                    },
                    component: customerServices
                },
                {
                    path: "/brand/manageAdvertising",
                    name: "manageAdvertising",
                    meta: {
                        requireAuth: true,
                    },
                    component: manageAdvertising
                },
                // 通道管理
                {
                    path: "/channel/channelShopList",
                    name: "channelShopList",
                    meta: {
                        requireAuth: true,
                    },
                    component: channelShopList    
                },
                {
                    path: "/channel/channelShopDetail/:merchantNo?",
                    name: "channelShopDetail",
                    meta: {
                        requireAuth: true,
                    },
                    component: channelShopDetail   
                },
                // 认证管理
                {
                    path: "/identify/authInfo",
                    name: "authInfo",
                    meta: {
                        requireAuth: true,
                    },
                    component: authInfo
                },
                {
                    path: "/identify/authRealname",
                    name: "authRealname",
                    meta: {
                        requireAuth: true,
                    },
                    component: authRealname
                },
                {
                    path: "/identify/checkRealname/:phone?",
                    name: "checkRealname",
                    meta: {
                        requireAuth: true,
                    },
                    component: checkRealname
                },
                {
                    path: "/identify/checkShop/:userid?",
                    name: "checkShop",
                    meta: {
                        requireAuth: true,
                    },
                    component: checkShop
                },
                {
                    path: "/auth/manageBlacklist",
                    name: "manageBlacklist",
                    meta: {
                        requireAuth: true,
                    },
                    component: manageBlacklist
                },
                {
                    path: "/auth/setRolePermission",
                    name: "setRolePermission",
                    meta: {
                        requireAuth: true,
                    },
                    component: setRolePermission
                },
                /***
                 * 商户管理
                 */
                {
                    path: "/shop/shopInfo",
                    name: "shopInfo",
                    meta: {
                        requireAuth: true,
                    },
                    component: ShopInfo
                },
                {
                    path: "/shop/shopChannelList",
                    name: "shopChannelList",
                    meta: {
                        requireAuth: true,
                    },
                    component: ShopChannelList 
                },
                {
                    path: "/shop/addShop",
                    name: "addShop",
                    meta: {
                        requireAuth: true,
                    },
                    component: AddShop
                },
                {
                    path: "/shop/shopConfig/:type?/:shopId?",
                    name: "shopConfig",
                    meta: {
                        requireAuth: true,
                    },
                    component: ShopConfig
                },
                {
                    path: "/shop/terminalInfo",
                    name: "terminalInfo",
                    meta: {
                        requireAuth: true,
                    },
                    component: TerminalInfo
                },
                {
                    //终端详情管理
                    path: "/shop/terminalManage/:shopId?",
                    name: "terminalManage",
                    meta: {
                        requireAuth: true,
                    },
                    component: TerminalManage
                },
                {
                    path: "/shop/shopDetail/:shopId?",
                    name: "shopDetail",
                    meta: {
                        requireAuth: true,
                    },
                    component: ShopDetail
                },
                {
                    path: "/shop/shopAuth",
                    name: "shopAuth",
                    meta: {
                        requireAuth: true,
                    },
                    component: ShopAuth
                },
                {
                    path: "/shop/shopAuthDetail/:shopId?",
                    name: "shopAuthDetail",
                    meta: {
                        requireAuth: true,
                    },
                    component: ShopAuthDetail
                },
                {
                    path: "/shop/subbranchInfo",
                    name: "subbranchInfo",
                    meta: {
                        requireAuth: true,
                    },
                    component: SubbranchInfo
                },
                {
                    path: "/shop/subbranchDetail/:shopId?",
                    name: "subbranchDetail",
                    meta: {
                        requireAuth: true,
                    },
                    component: SubbranchDetail
                },
                // 台码管理
                {
                    path: "/qrcode/addCode",
                    name: "addCode",
                    meta: {
                        requireAuth: true,
                    },
                    component: AddCode 
                },
                {
                    path: "/qrcode/manageCode",
                    name: "manageCode",
                    meta: {
                        requireAuth: true,
                    },
                    component: ManageCode 
                },
                {
                    path: "/qrcode/switchAgent",
                    name: "switchAgent",
                    meta: {
                        requireAuth: true,
                    },
                    component: SwitchAgent 
                    
                }
            ]
        },
        {
            path: '/login',
            name: "login",
            component: login,
        }
    ]
})